package cn.exrick.xboot.modules.oauthClient.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @author Exrick
 */
@Data
@Entity
@Table(name = "oauth_client_details")
@TableName("oauth_client_details")
@ApiModel(value = "Oauth客户端管理")
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class OauthClientDetails{

    private static final long serialVersionUID = 1L;

    @Id
    @TableId
    @ApiModelProperty(value = "唯一标识")
    @NotNull
    private String clientId;

    @NotNull
    private String clientSecret;

    @NotNull
    private String scope;

    @NotNull
    private String authorizedGrantTypes;

    @NotNull
    private String webServerRedirectUri;

    @NotNull
    private String autoapprove;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "old client_id")
    private String oldClientId;
    
}